bitkeeper revision 1.1671 (42a1e8cdI_f9OiPqscVnjrOWWEVTmw)
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Sat, 4 Jun 2005 17:45:49 +0000 (17:45 +0000)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Sat, 4 Jun 2005 17:45:49 +0000 (17:45 +0000)
Add a manual 'sync_console' boot parameter that forces synchronous
console output. May be useful for systems that crash unexpectedly
and lose the last chunk of console output.
Signed-off-by: Keir Fraser <keir@xensource.com>
docs/src/user.tex
xen/drivers/char/console.c

index 37fe19abb640cebeabe4fc9f9f28269ea4db42cd..ccaf71b21ebd37f13a6a9dc50d22eee3bff9aa48 100644 (file)
@@ -1729,6 +1729,13 @@ editing \path{grub.conf}.
  transmitted/received character.
  [NB. Default for this option is `com1,vga'] 
 
+\item [sync\_console ]
+ Force synchronous console output. This is useful if you system fails
+ unexpectedly before it has sent all available output to the
+ console. In most cases Xen will automatically enter synchronous mode
+ when an exceptional event occurs, but this option provides a manual
+ fallback.
+
 \item [conswitch=$<$switch-char$><$auto-switch-char$>$ ] 
  Specify how to switch serial-console input between
  Xen and DOM0. The required sequence is CTRL-$<$switch-char$>$
index 7d7cafeaf54899a2b6a688726f853b953b82e394..db80be7983c7dce8256497c2367098f28287dba8 100644 (file)
 #include <asm/debugger.h>
 #include <asm/io.h>
 
-/* opt_console: comma-separated list of console outputs. */
+/* console: comma-separated list of console outputs. */
 static char opt_console[30] = OPT_CONSOLE_STR;
 string_param("console", opt_console);
 
-/* opt_conswitch: a character pair controlling console switching. */
+/* conswitch: a character pair controlling console switching. */
 /* Char 1: CTRL+<char1> is used to switch console input between Xen and DOM0 */
 /* Char 2: If this character is 'x', then do not auto-switch to DOM0 when it */
 /*         boots. Any other value, or omitting the char, enables auto-switch */
 static unsigned char opt_conswitch[5] = "a";
 string_param("conswitch", opt_conswitch);
 
+/* sync_console: force synchronous console output (useful for debugging). */
+static int opt_sync_console;
+boolean_param("sync_console", opt_sync_console);
+
 static int xpos, ypos;
 static unsigned char *video;
 
@@ -437,6 +441,12 @@ void init_console(void)
            XEN_COMPILER, XEN_COMPILE_DATE);
     printk(" Latest ChangeSet: %s\n\n", XEN_CHANGESET);
     set_printk_prefix("(XEN) ");
+
+    if ( opt_sync_console )
+    {
+        serial_start_sync(sercon_handle);
+        printk("Console output is synchronous.\n");
+    }
 }
 
 void console_endboot(int disable_vga)